<template>
	<view>
		<section class="plr24 bf mt20">
			<view class="flex_sb h100 tap" @click="clear">
				<view class="flex_a">
					<img src="/static/clear.png" mode="widthFix" style="width: 42rpx;" />
					<text class="ml24">清除缓存</text>
				</view>
				<img src="/static/arrowRight.png" style="width:16rpx;" mode="widthFix" />
			</view>
		</section>
		<!-- <footer class='plr60 ptb30 mt130'>
			<j-button classNames="lh90 ft32 cf border-r6 tac b-primary btn_tap" @click="logout">退出账号</j-button>
		</footer> -->
	</view>
</template>

<script>
	import {
		mapState,
		mapActions
	} from "vuex"
	export default {
		name: "index",
		data() {
			return {

			}
		},
		onLoad(e) {
			console.log(this.$store.state);
		},
		onShow() {

		},
		methods: {
			...mapActions({
				resetStates: "resetStates"
			}),
			switchChange(e) {
				console.log(e);
			},
			clear() {
				this.confirm({
					content: `是否清除应用缓存?`
				}).then(res => {
					if (res.confirm) {
						this.resetStates();
						this.toast('操作成功');
						uni.reLaunch({
							url: '/pages/public/accredit/index'
						});
					}
				});
			},
			logout() {
				this.confirm({
					content: `请确认是否退出登录?`
				}).then(res => {
					if (res.confirm) {
						this.$store.commit('setUserToken', '');
						uni.reLaunch({
							url: '/pages/public/accredit/index'
						});
					}
				});
			}
		}
	}
</script>

<style scoped lang='scss'>

</style>
